#include <stdio.h>
#include <assert.h>

#include "canvas_impl.h"

namespace visgrph
{

void canvas_impl::hline(uint x, uint y, uint length, color c)
{
	if (NULL == m_target)
		return;

	agg::rgba8 _c(c.red(), c.green(), c.blue());
	if (c.alpha() != 255)
		m_rmc.blend_hline(x, y, x + length - 1, _c, c.alpha());
	else
		m_rmc.copy_hline(x, y, x + length - 1, _c);
}

void canvas_impl::vline(uint x, uint y, uint height, color c)
{
	if (NULL == m_target)
		return;

	agg::rgba8 _c(c.red(), c.green(), c.blue());
	if (c.alpha() != 255)
		m_rmc.blend_vline(x, y, y + height - 1, _c, c.alpha());
	else
		m_rmc.copy_vline(x, y, y + height - 1, _c);
}

}; // namespace visgrph
/* EOF */
